
from DjangoDemo.scripts.Http_Management import Http_Management
from DjangoDemo.scripts.SiteID import Sites
from DjangoDemo.scripts.Token import Token


class UserLocation:
    # 默认深圳
    def __init__(self, site_name):

        self.site_name = Sites.get_mac(site_name)
        self.token = Token()
        # 定义接口的 URI
        GET_JOURNEY_URI = "/rest/campusrtlsservice/v1/rtls-location"
        # 配置 URL 和 Headers
        param = '''{
        "siteId":"857b706e-67d9-49c0-b3cd-4bd1e6963c07",
        "mapId":"37374acc-3bf5-44e7-9906-asdb6d3f373a",
        "startTime":"1623482800000",
        "endTime":"1623914800421"
        }'''

        self.r = Http_Management(self.token).get(GET_JOURNEY_URI, param)

if __name__ == '__main__':
    now = UserLocation("Shenzhen")
    print(now.r.json())